//
//  PlSManager.h
//  Injector
//
//  Created by ∞ on 13/11/07.
//  Copyright 2007 Emanuele Vulcano. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "PlSPreferencesController.h"

// Returned by -installPlugInAtPath:andReturnError:
enum {
	// Installed successfully. Hurrah!
	kPlSInstallDone,
	// Not a plug-in of my type. Try some other manager.
	// NOTE: This is not an error! It is an acceptable course
	// of action! It's only an error if all plug-in managers
	// return it.
	kPlSInstallIncompatible,
	// I can handle this plug-in, but an error occurred. See my NSError.
	kPlSInstallError,
};
typedef NSInteger PlSInstallStatus;

@class PlSPlugIn;

@interface PlSManager : NSObject {
	id <PlSPreferencesController> preferencesController;
}

- (void) rescan;

@property(readonly) NSArray* plugIns;
@property(retain) id <PlSPreferencesController> preferencesController;

- (PlSPlugIn*) plugInWithIdentifier:(NSString*) ident;

- (BOOL) isLoadable:(PlSPlugIn*) plugIn;
- (void) setLoadable:(BOOL) loadable forPlugIn:(PlSPlugIn*) plugIn;

- (PlSInstallStatus) installPlugInAtPath:(NSString*) path andReturnError:(NSError**) error;

@end
